package graphic.primitives.car;

import graphic.primitives.general.GraphicObject;
import graphic.primitives.general.IGraphicObject;

public class Roof extends GraphicObject implements IGraphicObject {

	private int a;
	private int b;
	private int c;
	
	public Roof(int x, int y, int a, int b, int c){
		setABC(a, b, c);
		setXY(x, y);
	}
	private void setABC(int a, int b, int c) {
		this.a = a;
		this.b = b;
		this.c = c;
	}
	@Override
	public void redraw() {
		mainWindow.line(x, y, x + ((c-a)/2), y - b);
		mainWindow.line(x + ((c-a)/2), y - b, x + ((c-a)/2) + a, y - b);
		mainWindow.line(x + ((c-a)/2) + a, y - b, x + c, y);
	}
}
